/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package ModelLayer;

import java.util.ArrayList;

/**
 *
 * @author Claus
 */
public class Invoice
{
	//Betalt/ikke betalt
	public static final int NOTPAID = 0;
	public static final int PAID = 1;

	//Betalingsmetoder
	public static final int CASH = 0;
	public static final int CREDITCARD = 1;
	public static final int BANKTRANSFER = 2;
	public static final int GIRO = 3;
	public static final int CASHONDELIVERY = 4;

	//Betalingstyper
	public static final int INSTANT = 0;
	public static final int QUARTERLY = 1;

	int invoiceNo;
	String paymentDate;
	int status;
	int paymentMethod;
	int paymentType;
	ArrayList<SalesOrder> orders;

	public Invoice(int invoiceNo, String paymentDate, int paymentMethod, int paymentType)
	{
		this.invoiceNo = invoiceNo;
		this.paymentDate = paymentDate;
		this.status = NOTPAID;
		this.paymentMethod = paymentMethod;
		this.paymentType = paymentType;
		this.orders = new ArrayList<SalesOrder>();
	}

        public Invoice() {
        }

	public float getPrice()
	{
		float price = 0.0f;

		for(SalesOrder order : orders)
		{
			price += order.getPrice();
		}

		return price;
	}

	public String getPaymentDate()
	{
		return paymentDate;
	}

	public void setPaymentDate(String paymentDate)
	{
		this.paymentDate = paymentDate;
	}

	public int getStatus()
	{
		return status;
	}

	public void setStatus(int status)
	{
		this.status = status;
	}

	public int getPaymentMethod()
	{
		return paymentMethod;
	}

	public void setPaymentMethod(int paymentMethod)
	{
		this.paymentMethod = paymentMethod;
	}

	public int getPaymentType()
	{
		return paymentType;
	}

	public void setPaymentType(int paymentType)
	{
		this.paymentType = paymentType;
	}

	public int getInvoiceNo()
	{
		return invoiceNo;
	}

	public void setInvoiceNo(int invoiceNo)
	{
		this.invoiceNo = invoiceNo;
	}

	public ArrayList<SalesOrder> getOrders()
	{
		return orders;
	}

	public void setOrders(ArrayList<SalesOrder> orders)
	{
		this.orders = orders;
	}
}
